#!/usr/bin python3
# -*- coding:utf-8 -*-
"""登录逻辑的处理"""
from gtm_server.common.database_pg import DBPool
from gtm_server.dao.user import get_user_by_account

def authentication(account, password):
    """
    用户登录认证
    """
    if account:
        with DBPool().get_session() as session:
            user = get_user_by_account(session=session, account=account)

            print(password)
            print(user.password)

        if user.password == password:
            return True
        else:
            return False
